Derive Go Docker tag from Dockerfile's GO_VERSION in update.sh#626
Open
Devansh-567 wants to merge 1 commit into
Open
Derive Go Docker tag from Dockerfile's GO_VERSION in update.sh#626Devansh-567 wants to merge 1 commit into
Devansh-567 wants to merge 1 commit into
Conversation
…ERSION Signed-off-by: Devansh-567 <devansh.jay.singh@gmail.com>
Devansh-567
force-pushed
the
codegen-go-version
branch
from
July 15, 2026 10:31
ee6c030 to
a1ac73b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes a hardcoded Go version literal in
codegen/update.shthat could silently drift out of sync withcodegen/Dockerfile. No functional/behavioral changes when versions already match, this only changes how the version is sourced.Problem
Three places currently encode a Go version, independently of each other:
go.mod:go 1.20codegen/Dockerfile:ARG GO_VERSION=1.20.5codegen/update.sh: hardcodedgolang:1.20for thego mod tidystepThey agree today, but nothing ties them together. Bumping the Dockerfile's
GO_VERSION(e.g. for a Go security patch or minor upgrade) doesn't touchupdate.sh, so thego mod tidystep could end up running against a different Go version than the one CI actually builds/tests with, a subtle, easy-to-miss source of drift.Change
codegen/update.shnow readsGO_VERSIONdirectly out ofcodegen/Dockerfile:GO_VERSION="$(sed -n 's/^ARG GO_VERSION=//p' codegen/Dockerfile)"and uses it for the
go mod tidycontainer instead of the hardcodedgolang:1.20tag. A guard checks the value was actually found and fails loudly (instead of silently runninggo mod tidyunder a stale/wrong image) if the Dockerfile'sARGline is ever renamed or removed.